import javax.microedition.midlet.*;//Khai bao goi midlet de su dung
import javax.microedition.lcdui.*;//Khai bao goi lcdui
public class FormMIDlet extends MIDlet implements CommandListener{
	//Khai bao cac bien
	private Display display;
	private Form mainform;
	private DateField dmy;
	private Command exit;
	//Ham tao
	public FormMIDlet(){		
		display = Display.getDisplay(this);//Gan bin display la la hien thi cua class nay
		mainform = new Form("Form's Name");//Tao form moi
		dmy = new DateField("Current Day",DateField.DATE);//Tao dayfield moi dmy
		exit = new Command("Exit",Command.EXIT,0);//Tao command exit	
		mainform.append("Hello, this is a text inside form !");// Chung ta co the noi them chuoi vao form ma khong can tao moi
		mainform.append(new DateField("Current Time",DateField.TIME));//DateFile cung co the duoc noi them ma khong can khai bao
		mainform.append(dmy);
		mainform.addCommand(exit);
		mainform.setCommandListener(this);		
	}
	public void startApp(){
			
			display.setCurrent(mainform);
	}
	public void pauseApp(){
	
	}
	public void destroyApp(boolean unconditional){
	
	}
	public void commandAction(Command c, Displayable d){
		destroyApp(false);
		notifyDestroyed();
	}
}